package ga.stopcriterias;

import ga.individuals.Individual;

import java.util.Collection;
import java.util.Collections;

public class OptimalStrategy implements StopStrategy {
	double cota;
	
	public OptimalStrategy(double cota) {
		this.cota = cota;
	}

	@Override
	public boolean execute(Collection<Individual> population) {
		Individual best = Collections.max(population);
		return (best.getFitnessValue()>this.cota);
	}
}